package org.mcache;

/**
 * @Author: tjc
 * @description
 * @Date Created in 17:43 2022-08-07
 */
public abstract class RedisObject {
    public boolean isRedisString() {
        return false;
    }

    public boolean isRedisDict() {
        return false;
    }

    public boolean isRedisList() {
        return false;
    }

    public boolean isRedisSet() {
        return false;
    }

    public boolean isRedisZSet() {
        return false;
    }

    public RedisString checkRedisString() {
        throw new IllegalStateException("Not RedisString type: " + getDebugInfo());
    }

    public RedisDict checkRedisDict() {
        throw new IllegalStateException("Not RedisString type: " + getDebugInfo());
    }

    public RedisString checkRedisSet() {
        throw new IllegalStateException("Not RedisSet type: " + getDebugInfo());
    }

    public RedisString checkRedisZSet() {
        throw new IllegalStateException("Not RedisZSet type: " + getDebugInfo());
    }

    public RedisString checkRedisList() {
        throw new IllegalStateException("Not RedisList type: " + getDebugInfo());
    }


    protected String getDebugInfo() {
        return "";
    }
}
